% igetl.m
% figures log likelihood function for ada inflation index
% needs x(r), y(s), a(t), b(t), Ns, sig

igetab;

log2pi = log(sqrt(2*3.14159));
logsig = log(sig);

l = 0;
%e=zeros(Ns,1);
for s=1:Ns, 
  %e(s) = -(x(i(s))-(y(s)-a(t(s)-BeginYear+1))/b(t(s)-BeginYear+1));
  l=l-(1/(2*sig^2))*(y(s)-a(t(s)-BeginYear+1)-x(i(s))*b(t(s)-BeginYear+1))^2;
end;
l = l - Ns*(log2pi+logsig);

%l
